<template lang="">
    <div>
        <el-form ref="form" :model="form" label-width="80px">
            <el-row :gutter="20">
                <el-col :span="8">
                    <el-form-item label="问卷名:">
                        <el-input v-model="form.conTitle"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="问卷状态:">
                        <el-select v-model="form.conPublish" placeholder="问卷状态">
                            <el-option label="未发布" value="0"></el-option>
                            <el-option label="已发布" value="1"></el-option>
                            <el-option label="已结束" value="2"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-button type="primary" round icon="el-icon-search" @click="toSearch">开始查找</el-button>
                    <el-button type="danger" round icon="el-icon-close" @click="clear">清空</el-button>
                </el-col>
            </el-row>
        </el-form>
    </div>
</template>
<script>
    export default {
        name: 'Search',
        data() {
            return {
                form: {
                    conTitle: '',
                    conPublish: ''
                }

            }
        },
        methods: {
            toSearch() {
                console.log(this.form);
                this.$bus.$emit('search', this.form)
            },
            clear() {
                this.form = {
                    conName: '',
                    conPublish: ''
                }
                this.$bus.$emit('clearSearch')
            }
        },
    }
</script>
<style lang="">

</style>